﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>PerView</title>
    <script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="../../Scripts/PageCreater/Scripts/PageCreater.js" type="text/javascript"></script>
    <script type="text/javascript">
        CKEDITOR.on('instanceReady', function (ev) {
            $.get("/TestPaperExma/GetTestPaperHTMLByID", { id: getUrlPara() }, function (data) {
                InsertHTML(data);
            });
        });
        $(document).ready(function () {
            var a = $("#PersId").val(); ;
            if (a == 'True') {
                $("#exam").attr({ checked: "checked" });

            }
        });
        function InsertHTML(val) {
            var editor = CKEDITOR.instances.editor1;
            var value = val;
            if (editor.mode == 'wysiwyg') {
                editor.insertHtml(value);
            }
            else {
                alert('You must be in WYSIWYG mode!');
            }
        }

        function InsertText(val) {
            var editor = CKEDITOR.instances.editor1;
            var value = val;
            if (editor.mode == 'wysiwyg') {
                editor.insertText(value);
            }
            else {
                alert('You must be in WYSIWYG mode!');
            }
        }

        function SetContents(val) {
            var editor = CKEDITOR.instances.editor1;
            var value = val;
            editor.setData(value);
        }

        function GetContents() {
            var editor = CKEDITOR.instances.editor1;
            return editor.getData();
        }
        function SubmitPage() {
            var item = $(":input:checked");
            var len = item.length;
            if (len > 0) {
                $("#exams").val("true");
            }
            else {

                $("#exams").val("false");
            }
            var ispass = $("#exams").val();
            var auditOpinion = $("#suggestion").val();
            var ID = $("#PerId").val();
            $.post("/TestPaperExma/PerView", {ID:ID, Ispass: ispass, AuditOpinion: auditOpinion }, function () {
                alert("提交成功！");
            });
        }

    </script>
</head>
<body>
    <textarea id="editor1" name="editor1"></textarea>
    <script type="text/javascript">
        CKEDITOR.replace('editor1', {
            on: {
                pluginsLoaded: function (evt) {
                    var doc = CKEDITOR.document, ed = evt.editor;
                    if (!ed.getCommand('bold'))
                        doc.getById('exec-bold').hide();
                    if (!ed.getCommand('link'))
                        doc.getById('exec-link').hide();
                }
            }
        });
    </script>
     <fieldset style="float: left; width: 100%; height: 100px; overflow-y: scroll;border:0;">
                <legend>审核意见</legend>
               <textarea style="height: 60px; width: 100%; overflow-x:hidden;overflow-y:hidden;"" id="suggestion" rows="1" cols="1" >@TempData["auditOpinion"]</textarea>
            </fieldset>
         <input type="checkbox"  id="exam" checked="checked"  /> 是否通过审核
         <br />
           <input type="button" value="提交" onclick="SubmitPage()" style="width: auto" /><br />
           <input type="hidden" id="PerId" value="@TempData["id"]" />
           <input type="hidden" id="PersId" value="@TempData["Isactive"]" />
            <input  type="hidden" value=""  id="exams"/>
</body>
</html>
